package com.alfy.springbootcondition;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringBootConditionApplication {

    public static void main(String[] args) {
        // 启动 SpringBoot 应用，返回 Spring 的 IOC 容器
        ConfigurableApplicationContext run = SpringApplication.run(SpringBootConditionApplication.class, args);
        // 获取 Bean, redisTemplate
//        Object redisTemplate = run.getBean("redisTemplate");
//        System.out.println(redisTemplate);
    }
    // 运行报错：Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'redisTemplate' available

}
